﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameEngine;
using Microsoft.Xna.Framework;

namespace GameBoardViewer.Animation
{
    internal abstract class MoveAnimation: Animation
    {
        protected Vector3 _startPos;
        protected Vector3 _finishPos;


        public MoveAnimation(Position figurePos, Vector3 startPos, Vector3 finishPos, TimeSpan animationLength)
            : base(figurePos, animationLength)
        {
            _startPos = startPos;
            _finishPos = finishPos;
        }

        public override Vector3 GetFigureAnimationPos()
        {
            float delta = 0;
            if(GetAnimationDelta(out delta) == false)
            {
                return _finishPos;
            }

            return CalculatePosition(delta);
        }

        protected abstract Vector3 CalculatePosition(float elapsedTime);    
    }
}
